const log4js = require('log4js')
const configure = require('little-man-config')

log4js.configure(configure.get('log4js'))

const project = log4js.getLogger('project')
const error = log4js.getLogger('error')
const out = log4js.getLogger('out')

exports.useLog = function () {
    return log4js.connectLogger(project, { level: 'info' })
}

exports.debug = function (...msg) {
    project.level = 'debug'
    return project.debug(...msg)
}

exports.error = function (...msg) {
    error.level = 'error'
    return error.error(...msg)
}

exports.out = function (...msg) {
    out.level = 'info'
    return out.info(...msg)
}

